package org.dromara.generator.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.models.security.SecurityScheme;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;

@Data
@TableName("gen_table_index")
@EqualsAndHashCode
public class GenTableIndex {
    @TableId(value = "index_id", type = IdType.AUTO)
    private Integer indexId;
    /**
     * 归属表编号
     */
    private Long tableId;
    /**
     * 归属表名称
     */
    private String tableName;
    /**
     * 索引名称
     */
    private String indexName;
    /**
     * 索引类型
     */
    private String indexType;
    /**
     * 索引列名
     * DEMO id,user_name
     */
    private String indexColumnName;

    /**
     * 索引列名列表
     *
     */
    @TableField(exist = false)
    private String[] columnNames;


    public void setIndexColumnName(String columnName){
        this.indexColumnName = columnName;
        this.columnNames = columnName.split(",");
    }
}
